﻿using System;

namespace DailyFx.AI
{
	/// <summary>
	///		a detailed step of work for a <see cref="IPlan"/>
	/// </summary>
	public interface ITask
	{
		/**
		 * Gets the label of this task .
		*/
		String Label { get; }


		/**
		 * Indicates if the ployment should exit,
		 *  at the time when this step is beening executed.
		*/
		bool final ();

	}

	public sealed class NonTask : ITask
	{
		private static NonTask _singleton = new NonTask();

	   public static NonTask Singleton
	   {
		   get { return _singleton ; }
	   }
	   
		
		private NonTask () 
	    {
	    }
	

	   public String Label 
	   {
	      get { return "NON_TASK"; }
	   }
	
	   public bool final ()
	   {
	      return false ;
	   }
	
	   public override bool Equals ( Object obj )
	   {
	      return obj != null && ( obj is NonTask );
	   }
	
	   public override int GetHashCode()
	   {
	      return typeof(NonTask).GetHashCode() ;
	   }

	   public override string ToString()
	   {
		   return this.Label;
	   }
	}

}
